import request from '@/utils/request'

// 查询评价记录列表
export function listEvaluations(query) {
  return request({
    url: '/api/supplier/evaluation/list',
    method: 'get',
    params: query
  })
}

// 根据供应商ID查询评价记录
export function getEvaluationsBySupplierId(supplierId) {
  return request({
    url: '/api/supplier/evaluation/supplier/' + supplierId,
    method: 'get'
  })
}

// 查询评价记录详细
export function getEvaluation(evaluationId) {
  return request({
    url: '/api/supplier/evaluation/' + evaluationId,
    method: 'get'
  })
}

// 新增评价记录
export function addEvaluation(data) {
  return request({
    url: '/api/supplier/evaluation',
    method: 'post',
    data: data
  })
}

// 修改评价记录
export function updateEvaluation(data) {
  return request({
    url: '/api/supplier/evaluation',
    method: 'put',
    data: data
  })
}

// 删除评价记录
export function deleteEvaluation(evaluationId) {
  return request({
    url: '/api/supplier/evaluation/' + evaluationId,
    method: 'delete'
  })
}
